<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<div class="container">
    <div class="page-header">
        <div class="pull-right">
            <ul class="page-header-links">
                <li><a href="<c:url value='/pages/torneos/ConsultarTorneos'/>">volver a Mis Torneos</a></li>
                <li><a href="#">cerrar sesión</a></li>
            </ul>
        </div>
        <div class="pull-left"><img src="<c:url value='/img/whoisbetter.jpg'/>" alt="dreams time free" width="100" height="100" /></div>
        <h1>Crear Torneo</h1>
    </div> <!-- /page header -->
    <br />
    <form:form class="form-horizontal form-actions" action="CrearTorneo" method="post" commandName="torneo">
        <div class="control-group">
            <label class="control-label" for="Uri">Enlace</label>
            <div class="controls">
                <form:input class="input-xlarge" path="enlace" for="txtUri" readonly="yes"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Name">Nombre&nbsp;del&nbsp;Torneo</label>
            <div class="controls">
                <form:input type="text" id="Name" path="nombre" class="input-xxlarge" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Tipo">Tipo</label>
            <div class="controls">
                <form:select id="Tipo" path="flgModoGrafico" class="input-small">
                    <option value="true">Imagen</option>
                    <option value="false">Texto</option>
                </form:select>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="CantPart">Cantidad&nbsp;de&nbsp;Participantes</label>
            <div class="controls">
                <form:input type="text" id="CantPart" path="numParticipantes" class="spin input-small" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="FeLanzamiento">Fecha&nbsp;de&nbsp;Lanzamiento</label>
            <div class="controls">
                <form:input type="text" id="FeLanzamiento" path="fechaInicio" class="datepicker input-small" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="FeCierre">Fecha&nbsp;de&nbsp;Cierre</label>
            <div class="controls">
                <form:input type="text" id="FeCierre" path="fechaFin"  class="datepicker input-small" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="CantCont">Cantidad&nbsp;de&nbsp;Contendores</label>
            <div class="controls">
                <form:input type="text" id="CantCont" path="numContendores" class="spin input-small" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Tipo">Estado</label>
            <div class="controls">
                <form:select id="Tipo" path="idEstado" class="input-small">
                    <option value="1">Planeamiento</option>
                    <option value="2">En curso</option>
                    <option value="3">Cerrado</option>
                </form:select>
            </div>
        </div>
        <div class="btn-toolbar pull-right">
            <button class="btn btn-small btn-primary" type="submit" id="add">Guardar</button>
        </div>
    </form:form>
    <!-- /buttons maintenance -->
</div> <!-- /container -->

<div class="modal hide fade" id="myModal">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>Alert!</h3>
    </div>
    <div class="modal-body">
        <p>¿Está seguro de eliminar el torneo?</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn">Cancelar</a>
        <a href="#" class="btn btn-primary">Aceptar</a>
    </div>
</div><!-- /modal dialog -->


<!-- javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<c:url value='/js/jquery/jquery.js'/>"></script>
<script src="<c:url value='/js/jquery/jquery-ui.js'/>"></script>
<script src="<c:url value='/js/jquery/jquery.numericupdown.js'/>"></script>
<script src="<c:url value='/js/bootstrap-modal.js'/>"></script>
<script src="<c:url value='/js/bootstrap-dropdown.js'/>"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#delete").bind("click", function () {
            $('#myModal').modal('show')
        });

        $(".datepicker").datepicker({
            showOn: "button",
            buttonImage: "../../img/calendar.gif",
            buttonImageOnly: true,
            dateFormat: 'dd/mm/yy'
        });

        $(".spin").NumericUpDown();
    });
</script>

